<?php

namespace app\admin\model\chase;

use think\Model;
use traits\model\SoftDelete;

class Recipe extends Model
{

    use SoftDelete;

    

    // 表名
    protected $table = 'recipes';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];
    
    public function category()
    {
        return $this->hasOne(RecipeCategories::class, 'id', 'cate_id');
    }
    
    public function images()
    {
        return $this->hasMany(RecipeImages::class, 'recipe_id', 'id');
    }






}
